# $Id$
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>

pkgname=lensfun
pkgver=0.3.2
pkgrel=7
pkgdesc="Database of photographic lenses and a library that allows advanced access to the database"
arch=(x86_64)
url="https://lensfun.sourceforge.net"
license=('LGPL3')
depends=('glib2')
makedepends=('python' 'libpng' 'doxygen' 'cmake')
optdepends=('python: for lensfun-update-data and lensfun-add-adapter')
source=("https://sourceforge.net/projects/lensfun/files/${pkgver}/${pkgname}-${pkgver}.tar.gz"
        lensfun-fix-python-install-dir.patch)
sha256sums=('ae8bcad46614ca47f5bda65b00af4a257a9564a61725df9c74cb260da544d331'
            '11e0f9ce2d5c5fef4373ce6adbb19dbcbcd8a10efa02447db9c92b03798d5654')

prepare() {
    cd $pkgname-$pkgver
  # Fix python module install path
    patch -p1 -i ../lensfun-fix-python-install-dir.patch
}

build() {
    cd ${pkgname}-${pkgver}
    cmake . \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_LIBDIR=lib \
      -DCMAKE_CXX_FLAGS="${CXXFLAGS} -fno-delete-null-pointer-checks"
    make all
}

package() {
    cd ${pkgname}-${pkgver}
    make DESTDIR="$pkgdir" install
}
